/*
 * @Description: 
 * @Version: 0.0
 * @Author: taosong
 * @Date: 2023-12-11 20:56:07
 * @LastEditors: taosong
 * @LastEditTime: 2023-12-11 21:05:55
 */
class People {
  constructor() {}
  doEat(who: string, where: string) {
    console.log(`who:${who}where${where}`)
  }
}

const eat = Object.getOwnPropertyDescriptor(People.prototype, 'doEat')

const targetMethod = eat!.value

eat!.value = (...args: any[]) => {
  console.log('拦截器前')
  targetMethod.apply(this, args)
  console.log('拦截器后')
}

Object.defineProperty(People.prototype, 'doEat', eat!)
// eat?.value('空的')s

let people = new People()

people.doEat('张三', '张家界')



export {}